/*package com.semidata.trp.frequency.redis;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import org.aredis.cache.AsyncRedisConnection;
import org.aredis.cache.RedisCommand;
import org.aredis.cache.RedisCommandInfo;

import com.semidata.rtd.core.datasource.DataSourceReader;
import com.semidata.rtd.core.datasource.redis.RedisDataSource;

public class RedisReader extends RedisCommon implements DataSourceReader {

	public RedisReader(RedisDataSource datasource) {
		super(datasource);
	}
	
	public void read(String database, String key) {
		read(database);
	}
	public void read(String database) {
		AsyncRedisConnection client = datasource.getClient(database, "");
		List<RedisCommandInfo> list = clientMap.get(client);
		if (list == null) {
			list = new ArrayList<RedisCommandInfo>();
			clientMap.put(client, list);
		}
		list.add(new RedisCommandInfo(RedisCommand.HGETALL, database));
		totalCommands.incrementAndGet();
	}
	public Object get(String database, String key) {
		Map<String, Object> map = resultMap.get(database);
		if (map == null)
			return null;
		return map.get(key);
		
	}
	public Object get(String database) {
		Map<String, Object> map = resultMap.get(database);
		if (map == null)
			return null;
		return map;
	}
	
	
}
*/